import axios from './axios'

let axiosInstance = axios()
export default {
    get(url,params,headers){
        let options = {}
        if(params){
            options.params = params
        }
        if(headers){
            options.headers = headers
        }
        return axiosInstance.get(url,options)
    },
    post(url,params,headers){
        let options = {}
        if(headers){
            options.headers = headers
        }
        return axiosInstance.post(url,params,options)
    },
    put(url,params,headers){
        let options = {}
        if(headers){
            options.headers = headers
        }
        return axiosInstance.put(url,params,options)
    },
    delete(url,params,headers){
        let options = {}
        if(headers){
            options.headers = headers
        }
        if(params){
            options.params = params
        }
        return axiosInstance.delete(url,options)
    }
}